<template>
    <div class="window-wrap">
        <div class="window-content" :style="'width:'+width">
            <img class="left" src="@/assets/window/BK_Z.png" alt=""/>
            <img class="center" src="@/assets/window/BK.png" alt=""/>
            <img class="right" src="@/assets/window/BK_Y.png" alt=""/>
            <div class="close" @click="close">
                <img src="@/assets/window/GB.png" alt=""/>
            </div>
            <div class="title">
                资讯详情
            </div>
            <div class="main">
                <div class="ctitle">
                    {{info.title}}
                </div>
                <div class="date">
                    <span>发布时间:</span>{{info.date}}
                </div>
                <div class="content" v-html="info.desc"></div>
            </div>
        </div>
    </div>
</template>
<script>
import { getBodyWidth } from '@/utils/index'

export default {
    props: {
        width: {
            default: '60%'
        },
        id: {
            default: ''
        },
        info: {
            default: {}
        }
    },
    methods: {
        close() {
            this.$emit('windowClose')
        }
    }
}
</script>
<style scoped lang="scss">
.window-wrap {
    position: fixed;
    top: 0;
    left: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    background: rgba(0, 0, 0, .6);
    width: 100%;
    height: 100%;
    z-index: 9999999999;
}

.emptyData {
    position: relative;
    z-index: 2;
    padding: 2vw;
    text-align: center;
    color: #fff;
}

.window-content {
    position: relative;
    box-sizing: border-box;
    padding: .8vw;

    .left, .center, .right {
        position: absolute;
        top: 0;
        width: 15%;
        height: 100%;
    }

    .left {
        left: 0;
    }

    .right {
        right: 0;
    }

    .center {
        top: 1%;
        height: 98%;
        width: 71%;
        left: 15%;
    }

    .close {
        position: absolute;
        z-index: 999999;
        top: .8vw;
        right: .6vw;
        width: 2.6vw;
        height: 1.2vw;
        display: flex;
        justify-content: center;
        align-items: center;
        background: url('../../assets/window/GB_D.png') no-repeat;
        background-size: 100% 100%;
        cursor: pointer;

        img {
            width: 20%;
        }
    }

    .title {
        position: absolute;
        top: -.4vw;
        left: 50%;
        transform: translate(-50%, 0);
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 1.2vw;
        min-width: 6vw;
        box-sizing: border-box;
        padding: .2vw 1.6vw;
        color: #A6F4FF;
        background: url('../../assets/window/BT_D.png') no-repeat;
        background-size: 100% 100%;
    }

    p {
        color: #fff;
    }
}

.main {
    position: relative;
    z-index: 2;
    margin: 2vw 1vw .4vw 1vw;
    max-height: 35vw;
    overflow-y: scroll;
    background: #fff;
    padding: .6vw;

    .ctitle {
        font-size: 1.6vw;
        color: #000;
        text-align: left;
        font-weight: bold;
        padding: .6vw 0 0 0;
    }

    .date {
        margin: .8vw 0;
        color: #000;
        font-size: 1vw;

        span {
            display: inline-block;
            margin: 0 .6vw 0 0;
        }
    }

}

::-webkit-scrollbar-track-piece { //滚动条凹槽的颜色，还可以设置边框属性
    background-color: rgba(255, 255, 255, .4);
}

::-webkit-scrollbar { //滚动条的宽度
    width: 4px;
    height: 4px;
}

::-webkit-scrollbar-thumb { //滚动条的设置
    background-color: rgba(55, 159, 213, 0.8);
    background-clip: padding-box;
    min-height: 28px;
}

::-webkit-scrollbar-thumb:hover {
    background-color: #bbb;
}
</style>
